<?php

namespace Yolo\Utils;

class Str
{

    /**
     * Get last part of string.
     * @param string $str string
     * @param string $separator separator of string
     * @return string
     */
    public static function getLast(string $str, string $separator = '.'): string
    {
        $pos = mb_strrpos($str, $separator);
        if (!$pos) {
            return $str;
        }
        return mb_substr($str, $pos + 1);
    }
}
